package networking.assignments;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.net.ServerSocket;
import java.net.Socket;

public class Server1 {
	public static void main(String args[]) throws Exception {
		ServerSocket ss = new ServerSocket(1947);
		System.out
				.println("Server is ready with port no. " + ss.getLocalPort());
		Socket s = ss.accept();
		System.out.println("Connection Established");

		DataInputStream in = new DataInputStream(s.getInputStream());
		System.out.println(in.readUTF());

		DataOutputStream out = new DataOutputStream(s.getOutputStream());
		out.writeUTF("welcome.");
	}
}
